package com.e3.basdoc.dept.client;

import java.util.List;

import com.e3.basdoc.dept.model.DeptModel;
import com.e3.basdoc.dept.model.DeptQC;
import com.e3.web.core.client.RPCServiceHelper;
import com.e3.web.core.client.WebException;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;

public interface DeptRPCService extends RemoteService {

	public static class Util {

		private static DeptRPCServiceAsync instance;

		public static DeptRPCServiceAsync getInstance() {
			instance = (DeptRPCServiceAsync) RPCServiceHelper.getService(DeptRPCService.class.getName());
			if (instance == null) {
				instance = GWT.create(DeptRPCService.class);
				RPCServiceHelper.registerServiceEntryPoint(instance);
			}
			return instance;
		}

	}

	DeptModel newDept(DeptModel deptModel) throws WebException;

	List<DeptModel> getDeptsByCondition(DeptQC deptQC) throws WebException;

	DeptModel modifyDept(DeptModel deptModel) throws WebException;

	void deleteDepts(List<DeptModel> deptModels) throws WebException;

	List<DeptModel> getDeptChildren(DeptModel deptModel) throws WebException;

	DeptModel getDeptById(String id) throws WebException;

}
